"""用一个函数检测一个类中是否含有某些行为"""

class Dog:
    def eat(self):
        pass
    def run(self):
        pass

def someone(duck):
    duck.eat()
    duck.run
    #......其他行为

dog = Dog()
someone(dog)  #不包含eat，run动作，报异常
